#include <iostream>
#include<cstdlib>
#include <cstddef>
#include "fenTree.h"


int main()
{
    size_t n;
    std::cin >> n;
    fenTree<int> now(n);
    std::string com = "NONE";
    while (com != "end")
    {
        std::cin >> com;
        if (com == "set")
        {
            int x, v;
            std::cin >> x >> v;
            now.inc(x, v);
        }
        else if (com == "sum")
        {
            int x, y;
            std::cin >> x >> y;
            std::cout << "sum on [" << x << ";" << y << "): " << now.sum(x, y) << "\n";
        }
        else if (com == "out")
        {
            std::cout << "data:";
            for (size_t i = 0; i < n; ++i)
                std::cout << " " << now.sum(i, i + 1);
            std::cout << "\n";
        }
    }

    return 0;
}
